home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / Zoners Half-Life Tools / netvis / c2cpp.h next >
C/C++ Source or Header  |  2001-04-25  |  3KB  |  82 lines

  1. #ifndef C2CPP_H__
  2. #define C2CPP_H__
  3.  
  4. #if _MSC_VER >= 1000
  5. #pragma once
  6. #endif // _MSC_VER >= 1000
  7.  
  8. #ifdef HAVE_CONFIG_H
  9. #include "config.h"
  10. #endif
  11.  
  12. #include "win32fix.h"
  13.  
  14. // This tracks the current step of execution
  15. enum vis_states
  16. {
  17.     VIS_STARTUP,
  18.     VIS_BASE_PORTAL_VIS,
  19.     VIS_BASE_PORTAL_VIS_SERVER_WAIT,    // waiting on server to finish its baseportalvis()
  20.     VIS_PORTAL_FLOW,
  21.     VIS_WAIT_CLIENTS,
  22.     VIS_POST,
  23.     VIS_DONE,
  24.     VIS_CLIENT_DONE,
  25.     VIS_NO_SERVER
  26. };
  27.  
  28. // These are the different types of execution
  29. enum vis_modes
  30. {
  31.     VIS_MODE_NULL,
  32.     VIS_MODE_SERVER,
  33.     VIS_MODE_CLIENT
  34. };
  35.  
  36.  
  37. // SocketThreads functions (callable by hlvis code)
  38.  
  39. extern bool isConnectedToServer();
  40.  
  41. extern void ConnectToServer(const char* addr, short port);
  42. extern void DisconnectFromServer();
  43.  
  44. extern void StartNetvisSocketServer(short port);
  45. extern void StopNetvisSocketServer();
  46.  
  47. extern void StartPingThread();
  48. extern void StopPingThread();
  49.  
  50. extern void StartStatusDisplayThread(unsigned int rateseconds);
  51. extern void StopStatusDisplayThread();
  52.  
  53. extern void NetvisSleep(unsigned long amt);
  54.  
  55. // packet.cpp globals
  56. extern bool                     g_NetvisAbort;
  57.  
  58. // vis.c globals
  59. extern unsigned long            g_clientid;
  60. extern volatile int             g_visportalindex;                      // a client's portal index
  61. extern volatile int             g_visportals;                          // the total portals in the map
  62. extern volatile int             g_visleafs;                            // the total portal leafs in the map
  63. extern volatile int             g_vislocalportal;                      // number of portals solved locally
  64. extern volatile enum vis_states g_visstate;                // current step of execution
  65. extern volatile enum vis_modes  g_vismode;                  // style of execution (client or server)
  66. extern volatile int             g_visleafthread;                       // control flag (are we ready to leafthread)
  67. extern volatile unsigned long   g_serverindex;               // client only variable, server index for calculating percentage indicators on the client
  68. extern volatile unsigned long   g_idletime;                  // Accumulated idle time in milliseconds
  69. extern volatile double          g_starttime;                 // Start time (from I_FloatTime())
  70.  
  71. extern volatile bool            g_bsp_downloaded;
  72. extern volatile bool            g_prt_downloaded;
  73. extern volatile bool            g_mightsee_downloaded;
  74. extern char*                    g_bsp_image;
  75. extern char*                    g_prt_image;
  76. extern unsigned long            g_bsp_compressed_size;
  77. extern unsigned long            g_prt_compressed_size;
  78. extern unsigned long            g_bsp_size;
  79. extern unsigned long            g_prt_size;
  80.  
  81. #endif//C2CPP_H__
  82.